package com.es.business.city;

import javax.servlet.http.HttpServletRequest;

import com.es.business.citys.CitysBiz;
import com.es.main.LoginUserBeen;
import com.es.util.common.CommonBiz;
import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class CityInsertInitAction extends ActionSupport
implements ServletRequestAware{
	 HttpServletRequest request;

	public void setServletRequest(HttpServletRequest paramHttpServletRequest) {
		// TODO Auto-generated method stub
		this.request = paramHttpServletRequest;
	}
	
	public String execute() throws Exception{
		String result = "";
		CitysBiz citysBiz = new CitysBiz();
		String code = this.request.getParameter("queryCityCode");
		String value = this.request.getParameter("queryCityValue");
		
		String emp_province_code = request.getParameter("emp_province_code")==null?"":request.getParameter("emp_province_code");
		String emp_area_code = request.getParameter("emp_area_code")==null?"":request.getParameter("emp_area_code");
		
		CommonBiz biz = new CommonBiz((LoginUserBeen)request.getSession(false).getAttribute("loginuser"));
		 
		   
		   //区域列表
		   request.setAttribute("areaList", biz.getAreaList());
		   //城市群列表
		   request.setAttribute("cityslist",citysBiz.getCitysList());	
		   //省份列表
		   if(emp_area_code!=null)
			   request.setAttribute("provinceList", biz.getProvinceList(emp_area_code));
		if(code == null) code = "";	
		if(value == null) value = "";
		result = "success";
		return result;
	}
	 

}
